package com.project.m.api.busi.config;

import com.project.m.api.busi.bean.ext.*;
import com.project.m.api.busi.bean.hicatcard.*;
import com.project.m.api.busi.bean.hicatcard.card.*;
import com.project.m.api.busi.bean.inner.*;
import com.project.m.api.busi.bean.merchant.*;
import com.project.m.api.busi.handlers.hicatcard.*;
import com.project.m.api.busi.handlers.hicatcard.card.*;
import com.project.m.api.busi.handlers.hicatcard.merchant.*;
import com.project.m.api.busi.bean.ext.*;
import com.project.m.api.busi.bean.hicatcard.*;
import com.project.m.api.busi.bean.hicatcard.SmsCodeReq;
import com.project.m.api.busi.bean.hicatcard.SmsCodeResp;
import com.project.m.api.busi.bean.hicatcard.card.*;
import com.project.m.api.busi.bean.hicatcard.carlicence.CarLicenceQueryReq;
import com.project.m.api.busi.bean.hicatcard.carlicence.CarLicenceQueryResp;
import com.project.m.api.busi.bean.hicatcard.carlicence.CarLicenceUpdateReq;
import com.project.m.api.busi.bean.hicatcard.carlicence.CarLicenceUpdateResp;
import com.project.m.api.busi.bean.hicatcard.coupon.UserCouponListReq;
import com.project.m.api.busi.bean.hicatcard.coupon.UserCouponListResp;
import com.project.m.api.busi.bean.hicatcard.user.UserCardListReq;
import com.project.m.api.busi.bean.hicatcard.user.UserCardListResp;
import com.project.m.api.busi.bean.hicatcard.user.UserDistributorReq;
import com.project.m.api.busi.bean.hicatcard.user.UserDistributorResp;
import com.project.m.api.busi.bean.hicatcard.weixin.QRCodeGenerateReq;
import com.project.m.api.busi.bean.hicatcard.weixin.QRCodeGenerateResp;
import com.project.m.api.busi.bean.inner.InnerCardListQueryReq;
import com.project.m.api.busi.bean.inner.InnerCardListQueryResp;
import com.project.m.api.busi.bean.inner.InnerCardPresentReq;
import com.project.m.api.busi.bean.inner.InnerCardPresentResp;
import com.project.m.api.busi.bean.merchant.*;
import com.project.m.api.busi.handlers.hicatcard.*;
import com.project.m.api.busi.handlers.hicatcard.Inner.InnerCardListQueryBizHandler;
import com.project.m.api.busi.handlers.hicatcard.Inner.InnerCardPresentBizHandler;
import com.project.m.api.busi.handlers.hicatcard.Inner.InnerUserRegisterBizHandler;
import com.project.m.api.busi.handlers.hicatcard.Inner.InnerUserTransactionQueryBizHandler;
import com.project.m.api.busi.handlers.hicatcard.card.*;
import com.project.m.api.busi.handlers.hicatcard.carlicence.CarLicenceQueryBizHandler;
import com.project.m.api.busi.handlers.hicatcard.carlicence.CarLicenceUpdateBizHandler;
import com.project.m.api.busi.handlers.hicatcard.merchant.*;
import com.project.m.api.busi.handlers.hicatcard.user.UserCardListBizHandler;
import com.project.m.api.busi.handlers.hicatcard.user.UserCouponListBizHandler;
import com.project.m.api.busi.handlers.hicatcard.user.UserDistributorBizHandler;
import com.project.m.api.busi.handlers.hicatcard.wx.AuthCodeToOpenIdBizHandler;
import com.project.m.api.busi.handlers.hicatcard.wx.DecryptedDataBizHandler;
import com.project.m.api.common.biz.AbstractBizHandlerMapConfig;
import com.project.m.api.common.biz.BizHandlerConfigItem;
import com.project.m.api.common.biz.req.JsonBizRequestParser;
import com.project.m.api.common.util.SpringUtils;
import org.springframework.stereotype.Component;

@Component
public class BusiBizHandlerConfig extends AbstractBizHandlerMapConfig {

    @Override
    protected void init() {

        map.put("xiche.sms.code", new BizHandlerConfigItem<SmsCodeReq, SmsCodeResp>(
                new JsonBizRequestParser(SmsCodeReq.class), SpringUtils.getBean(SmsCodeHandler.class)));
        map.put("xiche.banner.query",
                new BizHandlerConfigItem<AdvertisementQueryReq, AdvertisementQueryResp>(
                        new JsonBizRequestParser(AdvertisementQueryReq.class),
                        SpringUtils.getBean(BannerQueryBizHandler.class)));
        map.put("xiche.wx.auth",
                new BizHandlerConfigItem<AuthCodeToOpenIdReq, AuthCodeToOpenIdResp>(
                        new JsonBizRequestParser(AuthCodeToOpenIdReq.class),
                        SpringUtils.getBean(AuthCodeToOpenIdBizHandler.class)));
        map.put("xiche.wx.decrypt", new BizHandlerConfigItem<DecryptDataReq, DecryptDataResp>(
                new JsonBizRequestParser(DecryptDataReq.class), SpringUtils.getBean(DecryptedDataBizHandler.class)));
        map.put("xiche.merchant.list", new BizHandlerConfigItem<MerchantListReq, MerchantListResp>(
                new JsonBizRequestParser(MerchantListReq.class), SpringUtils.getBean(MerchantListBizHandler.class)));
        // map.put("xiche.user.info", new BizHandlerConfigItem<UserInfoReq,
        // UserInfoResp>(
        // new JsonBizRequestParser(UserInfoReq.class),
        // SpringUtils.getBean(UserInfoBizHandler.class)));
        map.put("xiche.card.list", new BizHandlerConfigItem<CardListReq, CardListResp>(
                new JsonBizRequestParser(CardListReq.class), SpringUtils.getBean(CardListBizHandler.class)));
        map.put("xiche.card.order", new BizHandlerConfigItem<CardOrderReq, CardOrderResp>(
                new JsonBizRequestParser(CardOrderReq.class), SpringUtils.getBean(CardOrderBizHandler.class)));
        map.put("xiche.card.detail.query",
                new BizHandlerConfigItem<CardDetailQueryReq, CardDetailQueryResp>(
                        new JsonBizRequestParser(CardDetailQueryReq.class),
                        SpringUtils.getBean(CardDetailQueryBizHandler.class)));
        map.put("xiche.user.coupon.list",
                new BizHandlerConfigItem<UserCouponListReq, UserCouponListResp>(
                        new JsonBizRequestParser(UserCouponListReq.class),
                        SpringUtils.getBean(UserCouponListBizHandler.class)));
        map.put("xiche.card.activate", new BizHandlerConfigItem<CardActivateReq, CardActivateResp>(
                new JsonBizRequestParser(CardActivateReq.class), SpringUtils.getBean(CardActivateBizHandler.class)));
        map.put("xiche.user.card.list", new BizHandlerConfigItem<UserCardListReq, UserCardListResp>(
                new JsonBizRequestParser(UserCardListReq.class), SpringUtils.getBean(UserCardListBizHandler.class)));
        map.put("xiche.user.distributor", new BizHandlerConfigItem<UserDistributorReq, UserDistributorResp>(
                new JsonBizRequestParser(UserDistributorReq.class), SpringUtils.getBean(UserDistributorBizHandler.class)));
        map.put("xiche.car.licence.query",
                new BizHandlerConfigItem<CarLicenceQueryReq, CarLicenceQueryResp>(
                        new JsonBizRequestParser(CarLicenceQueryReq.class),
                        SpringUtils.getBean(CarLicenceQueryBizHandler.class)));
        map.put("xiche.car.licence.update",
                new BizHandlerConfigItem<CarLicenceUpdateReq, CarLicenceUpdateResp>(
                        new JsonBizRequestParser(CarLicenceUpdateReq.class),
                        SpringUtils.getBean(CarLicenceUpdateBizHandler.class)));
        map.put("xiche.card.collect", new BizHandlerConfigItem<CardCollectReq, CardCollectResp>(
                new JsonBizRequestParser(CardCollectReq.class), SpringUtils.getBean(CardCollectBizHandler.class)));
        map.put("xiche.transaction.list",
                new BizHandlerConfigItem<TransactionListReq, TransactionListResp>(
                        new JsonBizRequestParser(TransactionListReq.class),
                        SpringUtils.getBean(TransactionListBizHandler.class)));
        map.put("xiche.system.card.collect",
                new BizHandlerConfigItem<SystemCardCollectReq, SystemCardCollectResp>(
                        new JsonBizRequestParser(SystemCardCollectReq.class),
                        SpringUtils.getBean(SystemCardCollectBizHandler.class)));
        map.put("xiche.system.qrcode.generate",
                new BizHandlerConfigItem<QRCodeGenerateReq, QRCodeGenerateResp>(
                        new JsonBizRequestParser(QRCodeGenerateReq.class),
                        SpringUtils.getBean(QRCodeGenerateBizHandler.class)));
        map.put("xiche.service.list.query",
                new BizHandlerConfigItem<ServiceListReq, ServiceListResp>(
                        new JsonBizRequestParser(ServiceListReq.class),
                        SpringUtils.getBean(ServiceListQueryBizHandler.class)));

        map.put("xiche.card.change.list.query",
                new BizHandlerConfigItem<CardChangeListQueryReq, CardChangeListQueryResp>(
                        new JsonBizRequestParser(CardChangeListQueryReq.class),
                        SpringUtils.getBean(CardChangeListQueryBizHandler.class)));


        map.put("xiche.card.change.perform",
                new BizHandlerConfigItem<CardChangePerformanceReq, CardChangePerformanceResp>(
                        new JsonBizRequestParser(CardChangePerformanceReq.class),
                        SpringUtils.getBean(CardChangePerformanceBizHandler.class)));

        /*---------下面是商户api*/
        map.put("xiche.merchant.card.query",
                new BizHandlerConfigItem<MerchantCardQueryReq, MerchantCardQueryResp>(
                        new JsonBizRequestParser(MerchantCardQueryReq.class),
                        SpringUtils.getBean(MerchantCardQueryBizHandler.class)));
        map.put("xiche.merchant.transaction.perform",
                new BizHandlerConfigItem<MerchantTransactionPerformReq, MerchantTransactionPerformResp>(
                        new JsonBizRequestParser(MerchantTransactionPerformReq.class),
                        SpringUtils.getBean(MerchantTransactionPerformBizHandler.class)));
        map.put("xiche.merchant.transaction.return",
                new BizHandlerConfigItem<MerchantTransactionReturnReq, MerchantTransactionReturnResp>(
                        new JsonBizRequestParser(MerchantTransactionReturnReq.class),
                        SpringUtils.getBean(MerchantTransactionReturnBizHandler.class)));
        map.put("xiche.merchant.list.query",
                new BizHandlerConfigItem<MerchantListQueryReq, MerchantListQueryResp>(
                        new JsonBizRequestParser(MerchantListQueryReq.class),
                        SpringUtils.getBean(MerchantListQueryBizHandler.class)));
        map.put("xiche.merchant.transaction.query",
                new BizHandlerConfigItem<MerchantTransactionQueryReq, MerchantTransactionQueryResp>(
                        new JsonBizRequestParser(MerchantTransactionQueryReq.class),
                        SpringUtils.getBean(MerchantTransactionQueryBizHandler.class)));
        map.put("xiche.merchant.settle.query",
                new BizHandlerConfigItem<MerchantSettleQueryReq, MerchantSettleQueryResp>(
                        new JsonBizRequestParser(MerchantSettleQueryReq.class),
                        SpringUtils.getBean(MerchantSettleQueryBizHandler.class)));


        /*---------下面是内部api*/
        map.put("xiche.inner.card.list.query",
                new BizHandlerConfigItem<InnerCardListQueryReq, InnerCardListQueryResp>(
                        new JsonBizRequestParser(InnerCardListQueryReq.class),
                        SpringUtils.getBean(InnerCardListQueryBizHandler.class)));

        map.put("xiche.inner.card.present",
                new BizHandlerConfigItem<InnerCardPresentReq, InnerCardPresentResp>(
                        new JsonBizRequestParser(InnerCardPresentReq.class),
                        SpringUtils.getBean(InnerCardPresentBizHandler.class)));

        map.put("xiche.inner.user.register",
                new BizHandlerConfigItem<InnerUserRegisterReq, InnerUserRegisterResp>(
                        new JsonBizRequestParser(InnerUserRegisterReq.class),
                        SpringUtils.getBean(InnerUserRegisterBizHandler.class)));

        map.put("xiche.inner.user.transaction.query",
                new BizHandlerConfigItem<InnerUserTransactionQueryReq, InnerUserTransactionQueryResp>(
                        new JsonBizRequestParser(InnerUserTransactionQueryReq.class),
                        SpringUtils.getBean(InnerUserTransactionQueryBizHandler.class)));
    }
}
